import request from '@/utils/request'

// 查询商品规格关联关系列表
export function listRelation(query) {
  return request({
    url: '/module/rule/relation/list',
    method: 'get',
    params: query
  })
}


// 查询商品规格关联关系列表
export function getTransferData(query) {
  return request({
    url: '/module/rule/relation/getTransferData',
    method: 'get',
    params: query
  })
}


// 查询商品规格关联关系详细
export function getRelation(id) {
  return request({
    url: '/module/rule/relation/' + id,
    method: 'get'
  })
}

// 新增商品规格关联关系
export function addRelation(data) {
  return request({
    url: '/module/rule/relation',
    method: 'post',
    data
  })
}

// 修改商品规格关联关系
export function updateRelation(data) {
  return request({
    url: '/module/rule/relation',
    method: 'put',
    data
  })
}

// 删除商品规格关联关系
export function delRelation(id) {
  return request({
    url: '/module/rule/relation/' + id,
    method: 'delete'
  })
}



// 删除商品规格关联关系
export function removeByRuleId(data) {
  return request({
    url: '/module/rule/relation/removeByRuleId',
    method: 'delete',
    data
  })
}


// 导出商品规格关联关系
export function exportRelation(query) {
  return request({
    url: '/module/rule/relation/export',
    method: 'get',
    params: query
  })
}
